home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-03 | 14.7 KB | 24 lines | [TEXT/R*ch] |
- [19] How do I patch a trap?
-
- Here is some sample code for a head patch of Alert, a stack-based
- trap:
-
- TrapPtr gOldAlertTrapAddress;
-
- /****InstallPatch***************************************************/
-
- void
- InstallPatch (void)
- {
- gOldAlertTrapAddress = GetToolTrapAddress( _Alert );
- SetToolTrapAddress( (long) AlertPatch, _Alert );
- }
-
- /****AlertPatch***************************************************/
-
- pascal void
- AlertPatch( short alertID, ProcPtr filterProcPtr )
- {
- SetUpA4();
-
- MyAlert( alert